# while True:
#     num1 = input('num1:')
#     num2 = input('num2:')
#     try:
#         num1 = int(num1)
#         num2 = int(num2)
#         result = num1 + num2
#     except Exception as e:   # 捕获所有异常
#         print("异常:", e)
#         break
try:
    data=[]
    #data[1]
    dic = {}
    dic["name"]
except (IndexError, KeyError) as e:
    print("索引异常", e)
else:
    print("不报错,一切正常")
finally:
    print("总会执行")